package dto

type PaginationRequest struct {
	Page     int    `json:"page" form:"page" binding:"required,min=1"`
	PageSize int    `json:"page_size" form:"page_size" binding:"required,min=1,max=1000"`
	Keyword  string `json:"keyword" form:"keyword"`
}

func (p *PaginationRequest) Offset() int {
	return (p.Page - 1) * p.PageSize
}

type PaginationResponse[T any] struct {
	Total    int64 `json:"total"`
	Page     int   `json:"page"`
	PageSize int   `json:"page_size"`
	Items    []T   `json:"items"`
}
